<%--
  Created by IntelliJ IDEA.
  User: 箜絔lk
  Date: 2020/9/23
  Time: 19:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../plugins/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container">
    <form action="${pageContext.request.contextPath}/pet/update" method="post">
        <input type="hidden" name="id" id='pet_id' value="${pet.id}">
        <div class="form-group">
            <label>宠物头像：</label>
            <input type="text" class="form-control" name="imgUrl" id="imgUrl" value="${pet.imgUrl}" placeholder="请输入头像url">
        </div>

        <div class="form-group">
            <label>宠物名称：</label>
            <input type="text" class="form-control" name="name" id="name" value="${pet.name}" placeholder="请输入宠物名称">
        </div>

        <div class="form-group">
            <label>宠物年龄：</label>
            <input type="text" class="form-control" name="age" id="age" value="${pet.age}" placeholder="请输入宠物年龄">
        </div>

        <div class="form-group">
            <label>出生日期：</label>
            <input type="text" class="form-control" name="birthday" value="${pet.birthday}" id="birthday" placeholder="请输入出生日期">
        </div>

        <div class="form-group">
            <select id='petTypeSelect' name="petTypeSelect" class="form-control">
                <option value="-1">===宠物类型===</option>
                <c:forEach items="${types}" var="t">
                    <option
                            <c:if test="${pet.petTypeId==t.id}">selected</c:if> value='${t.id}'>${t.name}
                    </option>
                </c:forEach>

            </select>
        </div>

        <div class="form-group" style="text-align: center">
            <button type="submit" class="btn btn-primary" id="addid">修改</button>
        </div>
    </form>
</div>

<script src="../plugins/jquery/jquery.min.js"></script>

<script src="../plugins/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

</body>
</html>
